package indi.zhifa.study2025.oa.model.expose.user.dto;

import indi.zhifa.study2025.oa.model.enums.EGender;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.util.List;

@Data
public class CreateUserDto {
    @NotNull(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_-]{6,20}$", message = "用户名必须6位以上,20位以内，由英文数字_-组成")
    @Schema(title = "用户名")
    private String userName;

    @NotNull(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,20}$", message = "密码必须是6-20位的字母和数字组合")
    @Schema(title = "密码（明文）")
    private String passwd;

    @Schema(title = "昵称")
    private String nickName;

    @Schema(title = "手机号")
    private String phone;

    @Schema(title = "邮箱")
    private String mail;

    @Schema(title = "性别")
    private EGender gender;

    @Schema(title = "当前部门id")
    private Long depId;

    @Schema(title = "当前职位id")
    private Long positionId;

    @Schema(title = "角色Id列表")
    private List<Long> roleIds;

    @Schema(title = "部门Id列表，第一个为首要部门")
    private List<Long> depIds;

    @Schema(title = "职位Id列表，第一个为首要职位")
    private List<Long> positionIds;
}
